﻿@using QDT.Core
@using QDT.Core.Assignments
@using QDT.Core.Projects
@using QDT.Web
@model QDT.Common.IPagedList<QDT.Core.Assignments.Assignment>
@{
    ViewBag.Title = "债权转让列表";
    int i = 1;
}
  
<div id="jm-touch">
    <div class="tabs"><a href="@Url.Action("ProjectList","Home")" class=" ">项目列表</a><span class="split-line">|</span><a href="@Url.Action("Assignment","Home")" class="active ">债权转让</a></div>
    <div class="spaceholder"></div>
    <div id="jm-projects" class="project-list">
       <div class="bd">
            @foreach (var assign in Model)
            {
                Project project = Html.F().GetProject(assign.ProjectId);
                var agency = Html.F().GetAgency(project.Parent.AgencyId);
              
                        <a href="@Url.Action("Index","Assignment",new{id=assign.ID})" class="project status-1">
                            <div class="tit"><span class="category">(转)&nbsp;<span class="category">@project.Name</span></span><span class="contract"></span>
                                @if (agency == null)
                                {
                                    <span>资产抵押</span>
                                }
                                else
                                {
                                    <span>@agency.SubName</span>
                                }
                            </div>
                            <div class="company"> @(string.IsNullOrWhiteSpace(project.Parent.IndustryDetail) ? "" : project.Parent.IndustryDetail) </div>
                        
                            <div class="progress">
                                <div style="width: 23%" class="balances inbid">&nbsp;</div>
                            </div>
                            <div class="profit-c">
                                <table>
                                    <tbody>
                                        <tr>
                                            <td><span class="profit">@project.Rate</span><span class="symbol">.00%</span></td>
                                            <td><span class="maturity">@((project.RepayEndTime.Value.Date - DateTime.Now.Date).Days >= 0 ? ((project.RepayEndTime.Value.Date - DateTime.Now.Date).Days) : 0)</span><span class="symbol">天</span></td>
                                            <td><span class="amout">@assign.Money.ToMoney()</span><span class="symbol">元</span></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="invest">
                                <span href="/creditassign/2226" class="inbid">
                                    @if (assign.Status == AssignmentStatus.Cancel)
                                    {
                                        <span>已结束</span>
                                    }
                                    @if (assign.Status == AssignmentStatus.Completed)
                                    {
                                        <span>已卖出</span>
                                    }
                                    @if (assign.Status == AssignmentStatus.Progress)
                                    {
                                        if (assign.EndTime <= DateTime.Now)
                                        {
                                            <span>已结束</span>
                                        }
                                        else
                                        {
                                            <span>
                                                详情</span>
                                        }
                                    }
                                </span>
                                <div class="inbid">&nbsp;</div>
                            </div>
                        </a>
               
            }
           
      </div>
        <div class="more" id="moreAssign"><a href="@Url.Action("Assignment","Home",new{num=ViewBag.pageSize})">加载更多项目</a></div>

    </div>
</div>
